<div style="width:670px; float:left; padding-left:5px; margin-left:5px" class="border_radius">



<?php

	include_once("../../coms/xl_loaitrang.php");

	include_once("../../include/ckeditor/ckeditor.php");

	if(!isset($_REQUEST['malt'])):

		echo '<meta http-equiv="refresh" content="0;url=trangchu.php?key=tc" />';

	elseif(!is_numeric($_REQUEST['malt'])):

		echo '<meta http-equiv="refresh" content="0;url=trangchu.php?key=tc" />';

	else:

		$maloaitrang = $_REQUEST['malt'];

		$thongtin = new xl_loaitrang();

		$arr_lt = $thongtin->LayLoaiTrangTheoMa($maloaitrang);

		$title = '';

		if($maloaitrang==4):

			$title = 'tags';

		elseif($maloaitrang==11):

			$title = 'hotline';			

		elseif($maloaitrang==13):

			$title = 'thông điệp';			

		endif;

?>
  

<div class="content_right_title_admin">
Quản lý <?php echo $title;?>
</div> 
<div class="content_right_group_admin box_shadow" style="padding-bottom:5px">
<form method="post" name="fr_themhinhanh" action="trangchu.php?key=qlhl" enctype="multipart/form-data" >

    <table width="60%" align="center"  cellpadding="0" cellspacing="0" style="font-size:12px">



    	

      

         <tr>

            <td colspan="2" align="left" style="vertical-align:middle;">

				<?php 

					$CKEditor_NoiDung = new CKEditor();

					$CKEditor_NoiDung->basePath = '../../include/ckeditor/';

					$CKEditor_NoiDung->config['height'] = 120;

					$CKEditor_NoiDung->config['width'] = 590;

					$CKEditor_NoiDung->editor("noidung",$arr_lt['noidung']);

					

				?>

                <input type="hidden" name="hd_malt" value="<?php echo $maloaitrang; ?>">

            </td>

        </tr>

        <tr>

            <td colspan="2" align="center" style="vertical-align:middle;">

                <input type="submit" name="btn_CapNhat" value="Cập nhật" class="button small blue" style="margin-top:10px;"/>

                <input type="button" name="btn_QuayLai" value="Quay lại" class="button small blue" style="margin-top:10px;" onclick="history.back()"/>

            </td>

        </tr>

    </table>

</form>
</div>
<br>

<?php

	endif;		

?>



</div>





<?php

 

if(isset($_POST['btn_CapNhat']))

{

	$maloai = $_POST['hd_malt'];

	$noidung = $_POST['noidung'];

	if (strtoupper(substr($noidung, 0, 3)) == "<P>")

		$noidung = trim(substr($noidung, 3));

	if (strtoupper(substr($noidung, -4)) == "</P>")

		$noidung = substr($noidung, 0, -4);

	$upload = new xl_loaitrang();

	$ketqua = $upload->capnhat($maloai,$noidung,"","");

	echo '<script type="text/javascript">

					alert("Cập nhật thành công!!!");	

					window.location="trangchu.php?key=tc";				

				</script>';

	

}



?>